package com.example.springdemo.config;

import com.example.springdemo.filter.HttpTraceLogFilter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * HttpTraceConfiguration
 *
 * @author wenguang
 * @date 2020/12/14 16:34
 */
@Configuration
@ConditionalOnWebApplication
public class HttpTraceConfiguration {

    @ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
    static class ServletTraceFilterConfiguration {

        @Bean
        public HttpTraceLogFilter httpTraceLogFilter() {
            return new HttpTraceLogFilter();
        }

    }

}
